<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>

    // var ePattern = /^[A-Za-z0-9_\-\.]+\@[A-Za-z0-9_\-\.]+\.[A-Za-z]{2,4}$/;

    var ePattern = /^([A-Za-z0-9_\-\.]+)\@([A-Za-z0-9_\-\.]+)\.([A-Za-z]{2,4})$/;
    var res = ePattern.test("123@qq.com");
    console.log(RegExp.$1);
    console.log(RegExp.$2);
    console.log(RegExp.$3);
    console.log(RegExp.$4);


        // var str = `<script src=""><\/script>`


    // var reg = /^(1[345789]\d)(\d{4})(\d{4})$/;
    // var str = "15093105620";
    // var res = reg.test(str);
    // console.log(RegExp.$1);
    // console.log(RegExp.$2);
    // console.log(RegExp.$3);
    // console.log(RegExp.$4);


    var reg = /哈|啊|呀/g;
    var str = prompt();
    var res = str.replace(reg,"小可爱");
    console.log(res);

    
    </script>
</body>
</html>